Given the recent activity and advances I've seen on the Internet and Network Programming board lately I thought I'd share a method I use for easily providing LB with additional Internet and system capabilities.
Batch files. I've only come across a few examples in the past of someone using batch files with LB, but MS has provided a treasure of functions which can be run from the command prompt or a batch file, and LB can easily utilize these to expand or improve it's performance.
Here's a simple example for pinging a website to see if it's online or not and how fast the connection is to demonstrate how much easier this can be done with a batch file than by using 3rd party DLL's to connect LB to the Internet: (works on XP, not sure on lower versions as I haven't checked)
'START OF CODE
'Example for using batch files to easily expand LB's capabilities
'Free to use and abuse as you see fit
'create a batch file that will ping your server
open "newping.bat" for output as #1
'change the directory to C: - can be any letter drive and path you want to use
#1, "cd c:\"
'change the website address to whatever your address is
'the >ping.txt tells the batch file to write the results of the ping to a
'temp file named ping.txt in the directory we set above with the cd c:\ command
#1, "ping www.lbdownloads.com >ping.txt"
close #1
run "newping.bat", HIDE ' runs the batch file created above / HIDE prevents the commandline box from being displayed
call Pause 15000 'give connection 15 seconds to respond (raise to 30 seconds for dial-up connections)
open "C:\ping.txt" for input as #2 'open the temp file and read the results
while eof(#2) = 0
line input #2, temp$
print temp$ 'print results to main window
wend
close #2
kill "C:\ping.txt" 'delete temp file
kill "newping.bat" 'delete batch file
end
sub Pause mil
t=time$("milliseconds")
while time$("milliseconds")
Using the same methods a full-service telnet program, FTP program and more (perhaps an independant LB browser?) is at your fingertips.
As I mentioned, there are more than just Internet uses for using batch files. For full documentation on what can be done from the command prompt (and batch files) in XP check this out:
www.microsoft.com documentation
Hope this is of interest and use to some,
Scott Bannon
scott@banpro.net